import React, { Component } from 'react'
import routes from './routes'
import './App.less'
import { Route, Switch, Redirect } from 'react-router-dom'
import { AppFrame } from './components'
class App extends Component {
  render() {
    return (
      <AppFrame>
        <Switch>
          {//渲染路由
          //
          routes.map(route => {
            return (
              <Route
                key={route.path}
                path={route.path}
                component={route.component}
                exact={route.isExact}
              />
            )
          })}
          <Redirect exact to={routes[0].path} from="/" />
          <Redirect to="/404" />
        </Switch>
      </AppFrame>
    )
  }
}

export default App
